﻿/*
 * 接口操作日志与系统操作日志详情
 * 
 * addby zhongjian 20100420
 * 
 * */
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
using ExtBusiness;
using ExtBusiness.Interface;
using ExtBusiness.FlowOperation;


public partial class WebPubManager_SystemlogDetails : PageBase
{
    private WorkFlowPubSettting wfpsTemp = new WorkFlowPubSettting();
    protected void Page_Load(object sender, EventArgs e)
    {
        ViewState["flag"] = Request["flag"];
        if (!IsPostBack)
        {
            BindLogs();
        }
    }

    /// <summary>
    /// 绑定操作日志详情
    /// </summary>
    /// <!--addby zhongjian 20100420-->
    private void BindLogs()
    {
        if (ViewState["flag"] != null &&  Request["id"] != null)
        {
            DataTable dtTemp = new DataTable();
            if (ViewState["flag"].ToString() == "InterfaceLog")
            {                
                dtTemp = wfpsTemp.GetInterfaceLogs(Request["id"].ToString(), "", "", "0");
                trip.Visible = false;
                tropttype.Visible = false;
                truserid.Visible = false;
            }
            else
            {
                dtTemp = wfpsTemp.GetSystemLogs(Request["id"].ToString(), "", "", "", "0");
            }
            lbluserid.Text = dtTemp.Rows[0]["userid"].ToString();
            lblopttype.Text = dtTemp.Rows[0]["opttype"].ToString();            
            lblip.Text = dtTemp.Rows[0]["ip"].ToString();
            lblopttext.Text = dtTemp.Rows[0]["opttext"].ToString();
            taremark.Value = dtTemp.Rows[0]["remark"].ToString().Trim();
            taoptsql.Value = dtTemp.Rows[0]["optsql"].ToString().Trim();
            lblopttime.Text = dtTemp.Rows[0]["opttime"].ToString();
            if (!string.IsNullOrEmpty(taoptsql.Value))
                taoptsql.Rows = 7;
            if (ViewState["flag"].ToString() == "InterfaceLog" && !string.IsNullOrEmpty(taremark.Value))
                taremark.Rows = 8;
        }
    }
}
